home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GETLOGIN(3) MINTLIB LIBRARY FUNCTIONS GETLOGIN(3)
-
-
- N✓NA✓AM✓ME✓E
- getlogin - get login name
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- char *getlogin(void);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- getlogin returns a pointer to the user's login name. This
- is determined in the following way:
- - The name for the current userid is read from the
- password file using getuid and getpwuid.
- - If this fails, the environment variable USER is read.
- - If this fails, "user" is returned.
-
- This call returns a pointer to a dynamically allocated
- area of memory. Consecutive calls will return the same
- pointer.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- c✓cu✓us✓se✓er✓ri✓id✓d(✓(3✓3)✓),✓, g✓ge✓et✓tg✓gr✓re✓en✓nt✓t(✓(3✓3)✓),✓, g✓ge✓et✓tp✓pw✓we✓en✓nt✓t(✓(3✓3)✓),✓, g✓ge✓et✓tp✓pw✓wu✓ui✓id✓d(✓(3✓3)✓),✓,
- g✓ge✓et✓tu✓ui✓id✓d(✓(3✓3)✓)
-
- N✓NO✓OT✓TE✓ES✓S
- The method used to determine the user's login name, getp-
- wuid(getuid()), is supposed to be the most reliable way.
- It will fail if several users have identical numerical
- userids, though.
-
- On System V, this routine will read from /etc/utmp in
- order to find out the current user's login name. This
- method can be fooled by changing the terminal associated
- with standard input, and thus is no viable alternative.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-